﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YangHui
{
    class Program
    {
        static void Main(string[] args)
        {
            int[][] yh = new int[6][];
            for (int i = 0; i <yh.Length; i++)
            {
                yh[i] = new int[i + 1];
                for (int j = 0; j <yh[i].Length; j++)
                {
                    if (j==0||j==yh[i].Length-1)
                    {
                        yh[i][j] = 1;
                    }
                    else
                    {
                        yh[i][j] = yh[i - 1][j] + yh[i - 1][j - 1];
                    }
                }
            }
            for (int i = 0; i < yh.Length; i++)
            {
                for (int j = 0; j <yh[i].Length; j++)
                {
                    Console.Write(yh[i][j]+" ");
                }
                Console.WriteLine();
            }
            Console.ReadKey();
        }
    }
}
